<?php

namespace App\Admin\Controllers\Weikong;

use App\Models\Device;
use App\Models\Project;
use App\Models\ProjectPlan;
use App\Models\DeviceType;
use App\Http\Controllers\Controller;
use Dcat\Admin\Grid;
use Dcat\Admin\Layout\Content;
use Dcat\Admin\Widgets\Callout;
// use Encore\Admin\Facades\Admin;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Cache;
use Dcat\Admin\Form;
use Dcat\Admin\Admin;
use Dcat\Admin\Show;
use Log;
use SuperEggs\DcatDistpicker\Form\Distpicker;
use Dcat\Admin\Widgets\Form as Form1;
use Illuminate\Http\Request;
use Dcat\Admin\Widgets\Tab;
use App\Models\ProjectUser;
use Dcat\Admin\Form\NestedForm;
// use App\Admin\Extensions\Form\ApiSelect\ApiSelect;

class CreateGroupController extends Controller
{

    public function create(Content $content){
        return $content
            ->title('新增分组')
            ->description('创建')
            ->body($this->form());
    }
    public function form(){
         return Form::make(new Device(), function (Form $form) {
            $guizi = session('guizi');
            $form->text('group','分组IP');
            $form->hidden('pid')->value(session('guizi'));
            $form->hidden('device_type')->value('10');
            $form->action('PostGroup');
            // $form->text('gatewayId','平台编号');
            // $form->text('devicename','设备名称');
        });
    }
    public function update($id){
        return $this->form()->update($id);
    }
    public function store(){
        return $this->form()->store();
    }

    public function destroy($id){
        return $this->form()->destroy($id);
    }
}